package top.jiangqiang.qyblog.core.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
import top.jiangqiang.qyblog.core.handler.JacksonTypeHandler;

import java.io.Serial;
import java.io.Serializable;

/**
 * <p>
 * 缓存持久化表
 * </p>
 *
 * @author JiangQiang
 * @since 2023-05-15
 */
@Data
@Accessors(chain = true)
@TableName(value = "sys_cache", autoResultMap = true)
public class SysCache implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private Long id;
    /**
     * 缓存的key
     */
    private String cacheKey;
    /**
     * 缓存的value
     */
    @TableField(typeHandler = JacksonTypeHandler.class)
    private Object cacheValue;
    /**
     * 过期时的时间戳，-1表示不过期
     */
    private Long expirationTime;
}
